class Person1 {
  public name: string;
  age: number; //默认是public
  constructor(name: string, age: number) {
    this.name = name;
    this.age = age;
  }

  speak() {
    console.log(`我叫:${this.name},今年${this.age}岁`);
  }
}

class Student1 extends Person1 {
  study() {
    console.log(`${this.name}正在努力学习中`);
  }
}

const p2 = new Person1("tom", 18);
p2.name;
p2.age;
p2.speak();
